package org.ricks.db;

import org.ricks.common.db.SnowflakeIdWorker;

/**
 * @author chenwei
 * @Title:
 * @Package
 * @Description:
 * @date 2020/12/1420:26
 */
public class BaseLongIDEntity<K> extends AbstractEntity<K,Long> {

    private final static SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker(0,0);

    @PrimaryKey()
    @Column(comment = "ID")
    private Long id = snowflakeIdWorker.nextId();

    @Column()
    @IndexKey
    private long roleId;

    public BaseLongIDEntity() {
    }

    public BaseLongIDEntity(long roleId) {
        this.roleId = roleId;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public long getRoleId() {
        return roleId;
    }

    public void setRoleId(long roleId) {
        this.roleId = roleId;
    }
}
